import React, { Component } from 'react';

class App extends Component {
    handlAddClick = (params) => {
        console.log("执行add")
    }
    handlSubClick = (params) => {
        console.log("执行了sub")
    }
    //react 阻止默认事件
    handleClick = (e) => {
        e.preventDefault()
        console.log(e)
    }
    render() {
        return (
            <div>
                <button onClick={this.handlAddClick}>+</button>
                <span id="num"></span>
                <button onClick={this.handlSubClick}>-</button>
                <a href="http://www.bing.com" onClick={this.handleClick}>bing</a>
            </div>
        );
    }
}

export default App;
